﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace WorldOnFire
{
    public class CDestroyer : ABCEnemy
    {
        public override void Initialize(int _nObjectCount)
        {
            base.Initialize(_nObjectCount);

            // Initialize the members
            m_fOrbitAngleLock = 0.25f;

            for (int iObject = 0; iObject < _nObjectCount; ++iObject)
            {
                m_fMass = 100.0f;
                m_fEngineForce = 10.0f * m_fMass;
                m_fMaximumSpeed = 10.0f;
                m_fTurnSpeed = 0.2f * (float)Math.PI;

                m_fMinimumRange = 200.0f;
                m_fMaximumRange = 200.0f;
                m_fShotDelayPrimary = 2.0f;
                m_fShotDelaySecondary = 0.0f;
                m_fShotSpeed = 25.0f;
                m_fDamage = 10.0f;
                m_fAreaOfEffect = 0.0f;
                m_fMaximumHealth = 250.0f;

                // TODO: SET TARGET INDEX
                m_nTargetIndex[iObject] = 0;
                m_fDisabledTimer[iObject] = 0.0f;
                m_fShotTimerPrimary[iObject] = 0.0f;

                // TODO: LOLWUT
                this.SetAIState(iObject, eAIState.CLOSING);
            }
        }

        public override void LoadContent()
        {
            m_eModelID = CRenderingManager.eModelID.ENEMY_DESTROYER;

            base.LoadContent();
        }

        protected override void FirePrimary(int _nIndex)
        {
            // TODO: Fire MOAR
            s_ObjectManager.GetProjectile(ABCProjectile.eProjectileType.PLASMA)
                .CreateProjectile(this, _nIndex, new Vector3(-10.0f, 0.0f, 7.5f));
            s_ObjectManager.GetProjectile(ABCProjectile.eProjectileType.PLASMA)
                .CreateProjectile(this, _nIndex, new Vector3(10.0f, 0.0f, 7.5f));
        }
    }
}
